<template>
	<view class="search" :style="{'backgroundColor': background_color}">
		<view class="search-item" :style="{'border-radius': radius + 'px'}" @click="gotoSearch" >
			<uni-icons type="search" size="18"></uni-icons>
            <text>搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		name:"my-search",
		// 自定义属性的背景颜色和圆角尺寸
		props:{
			background_color: {
				type: String,
				default: '#c00000',
			},
			radius: {
				type: Number,
				default:18
			}
		},
		data() {
			return {
				
			};
		},
		
		methods:{
			gotoSearch() {
				// console.log('ok')
				this.$emit('myclick')
			}
		}
	}
</script>

<style lang="scss">
 .search{
	 width: 100%;
	 height: 50px;
	 // background-color: #c00000;
	 display: flex;
	 align-items: center;
	 justify-content: center;
	 .search-item{
		 width: 85%;
		 height: 35px;
		 background-color: white;
		 // border-radius: 16px;
		 text-align: center;
		 display: flex;
		 flex-direction: row;
		 align-items: center;
		 justify-content: center;
		 text{
			 font-size: 14px;
			}
	 }
	 
 }
</style>